package com.center.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.center.R;
import com.center.model.CarttonHistoryModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cartoon.room.read.room.CartoonReadHistoryModel;
import pic.PicLoadManager;

public class CarttonHistoryAdapter  extends BaseQuickAdapter<CarttonHistoryModel, BaseViewHolder> {
    public CarttonHistoryAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<CarttonHistoryModel> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CarttonHistoryModel item) {
        ImageView pic = helper.itemView.findViewById(R.id.pic);
        TextView tv_title_name = helper.itemView.findViewById(R.id.tv_title_name);
        PicLoadManager.loadPicture(item.getPic(),pic);
        helper.setText(R.id.tv_title,item.getTitleName());
        helper.setText(R.id.tv_title_name, item.getName());

        tv_title_name.setSelected(true);
    }
}
